extends "../../../../azurlane_ctrl/ResearchChara.gd"

var getPlaneCount = 0
var getPlaneRnd = 10

func _extInit():
	._extInit()
	chaName = "「航母」白龙"   #角色的名称
	attInfox.maxHp = 1000
	attInfox.atk = 0
	attInfox.mgiAtk = 0
	attInfox.air = 60
	attInfox.def = 30
	attInfox.dod = 20
	attInfox.atkRan = 8
	lv = 1             #等级的设置
	ename = "bailong"
	type = sys.CharaClass.CV
	setCamp("重樱")
	hasAnime = true
	prefer = "air"

	torpFlag = false
	mainFlag = false
	carrierFlag = true

	if skills.empty():
		addSkill("<先手>每{cd}秒起飞一架受自身航空加成的<舰载机>(←点击可查看说明)", "舰载机", "castPlane", 15)

func _onBattleStart():
	._onBattleStart()
	var sk = getSkill("castPlane")
	sk.nowTime = sk.cd - 2
	if team == 1 && getPlaneRnd > 0 && sys.rndPer(getPlaneRnd):
		getPlaneCount += 1
		getPlaneRnd -= 5
		var item = sys.newItem("i_ex_equip_plane")
		item.postInit(false)
		sys.main.player.addItem(item)

func _castCdSkill(id):
	._castCdSkill(id)
	if id=="castPlane":
		self.castPlane()

func castPlane():
	return summPlane()

#舰载机onDeath时触发此函数
func onSummDeath(atkInfo):
	pass

#换算航空伤害
func getAirDmg(baseNum):
	return baseNum * (1 + att.air*0.01)

#执行extInit后执行此函数
func postInit():
	if lv == 2:
		attInfox.maxHp *= 1.5
		attInfox.def += 10
		attInfox.air *= 1.2
		cost += 1
	elif lv == 3:
		attInfox.maxHp *= 2
		attInfox.def += 20
		attInfox.dod += 10
		attInfox.air *= 1.5
		cost += 2
	elif lv == 4:
		attInfox.maxHp *= 3
		attInfox.def += 40
		attInfox.dod += 20
		attInfox.air *= 2
		cost += 5
	if team == 2:
		aiAdjust()
	upAtt()	
	if isInManual() and get("upText1") != null:
		showInManual()
	elif upgraded:
		upgrade()
	checkRealLove()		
	fillSkillSlotText()